import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/usr/account-password/base/list',
    method: 'get',
    params: query
  })
}

export function fetchAccountPassword(id) {
  return request({
    url: '/usr/account-password/base/one',
    method: 'get',
    params: { id }
  })
}

export function createAccountPassword(data) {
  return request({
    url: '/usr/account-password/base',
    method: 'post',
    data
  })
}

export function updateAccountPassword(data) {
  return request({
    url: '/usr/account-password/base',
    method: 'put',
    data
  })
}

export function createOrUpdateAccountPassword(data) {
  return request({
    url: '/usr/account-password/base/save-or-update',
    method: 'post',
    data
  })
}

export function decryptAccountPassword(data) {
  return request({
    url: '/usr/account-password/decrypt',
    method: 'get',
    params: data
  })
}

export function deleteAccountPassword(id) {
  return request({
    url: '/usr/account-password/base/' + id,
    method: 'delete'
  })
}
